from libavg import avg

from config import Config
from button import Button

class CombiButton(avg.DivNode):
    
    #dimensions
    __width = 0
    __height = 0
    __center = 0, 0
    __pts = None
    __health = None
    

    def __init__(self, size, parent, pos):
        avg.DivNode.__init__(self, size = size, parent=parent) 
        combiBoxStart = pos
        #settig size and center
        self.__pts = Button (size, self, combiBoxStart, "0") # INITIALISIERE PUNKTE = 0    
        self.__health = Button (size, self, (pos[0] + Config.scoreElementDelta, pos[1]), "100%") # INITIALISIERE ZUSTAND = 100
                            
    
    # SETZE PUNKTE AUF ANZEIGE
    def setPoints(self, points):
        self.__pts.setText(str(points))
        
        
    # SETZE ZUSTAND AUF ANZEIGE
    def setHealth(self, health): 
        self.__health.setText(str(health)+"%")